/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import Utils.DBConnection;
import Utils.Settings;
import Utils.Utils;
import com.mysql.jdbc.Util;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author user
 */
public class OrderDetailsModel {

    DBConnection db = new DBConnection(Settings.getDb(), Settings.getDbLogin(), Settings.getDbPassword());
    String message;

  
    public int AddOrderDetail(int orderID,int productID, float quantity) {
        try {

            String query = "INSERT INTO orders_detail (`OrderID`,`ProductID`,`Quantity`)"
		           +" VALUES ("+orderID+", "+productID+", "+quantity+")";

            int id = db.ExecuteInsert(query);
            return 1;

        } catch (Exception ex) {
            return -1;
        } finally {
            //  db.close();
        }
    }

    public String GetMessage() {
        return message;
    }
}
